

#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>

//#define kBaseURL @"http://106.37.202.210:6060/Anxun/app/"
#define kBaseURL @"http://192.168.1.126/Aerospace/index.php/Backstage/json?method="
//#define kBaseURL @"http://47.94.21.44/Aerospace/index.php/Backstage/json?method="


typedef void(^progress)(NSProgress * _Nonnull uploadProgress);
typedef void(^success)( NSURLSessionDataTask* _Nonnull dataTask, id _Nonnull responseObject);
typedef void(^failure)(NSURLSessionDataTask * _Nonnull dataTask, NSError * _Nonnull error);

@interface HTTPRequestManager : NSObject
#pragma clang diagnostic push
#pragma clang diagnostic ignored"-Wnullability-completeness"

@property (nonatomic, strong , readonly) AFHTTPSessionManager *sessionManager;
@property (nonatomic, copy) NSString *baseURL;
@property (nonatomic, copy) NSString *signString;

//- (void)HTTPRequestWithApiName:(NSString * _Nullable)apiName
//                    parameters:(id _Nullable)parameters
//                       success:(success)success
//                       failure:(failure)failure;

+ (instancetype)defaultManager;

//- (NSString *)generateSignatureWithApiName:(NSString *)apiName;
- (NSString *)generateRequestURLWithApiName:(NSString *)apiName;

- (void)HTTPPOSTRequestWithURLString:(NSString *)URLString
                      parameters:(id)parameters
                         success:(success)success
                         failure:(failure)failure;

- (void)HTTPGetRequestWithApiName:(NSString * _Nullable)apiName
                       parameters:(id _Nullable)parameters
                          success:(success)success
                          failure:(failure)failure;

#pragma clang diagnostic pop


@end
